import { Gateway, getGateway } from "@/droplet-bus/core.define";
import { PageDto } from "~/rest";
import { PageResult } from "~/search";

import { app_gateway } from "./core.local";
import { Journal } from "./schema.journal";

export const JournalGateway: Gateway = getGateway(app_gateway, "pond_journal");
export type getJournalDto = PageDto<Journal>;
export type getJournalRes = PageResult<Journal>;
export type postJournalDto = { schema: Journal };
export type postJournalRes = null;

export interface JournalInterfaceWithDerive<T> {
  get(dto: T & getJournalDto): Promise<getJournalRes>;
  post(dto: T & postJournalDto): Promise<postJournalRes>;
}
